package ioc

import (
	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/credentials"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/s3"
	"github.com/ecodeclub/ekit"
)

func Inits3() *s3.S3 {
	sess, err := session.NewSession(&aws.Config{
		Credentials: credentials.NewStaticCredentials("LTAI5tHiJko87NgDW2Sdg9xB", "dWYeCIp1q2wKSEPB8OYHfavlIoyJlc", ""),
		Region:      ekit.ToPtr[string]("cn-shenzhen"),
		Endpoint:    ekit.ToPtr[string]("oss-cn-shenzhen.aliyuncs.com"),
		//		/path/?/.
		S3ForcePathStyle: ekit.ToPtr[bool](false),
	})
	if err != nil {
		panic(err)
	}
	return s3.New(sess)
}
